﻿using System.Collections.Generic;
using Microsoft.VisualStudio.TemplateWizard;
using EnvDTE;

namespace Yama.TemplateWizard
{
    public class SolutionWizard : IWizard
    {
        private string _solutionName;
        private _DTE _dte;

        #region Implementation of IWizard

        public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            this._solutionName = replacementsDictionary["$safeprojectname$"];
            ProjectWizard.SolutionName = this._solutionName;

            this._dte = (_DTE)automationObject;
            ProjectWizard.Dte = this._dte;

            ProjectWizard.DotNetVersion = DotNetVersion;
        }

        protected virtual string DotNetVersion
        {
            get
            {
                return "v3.5";
            }
        }

        public void ProjectFinishedGenerating(Project project)
        {
        }

        public void ProjectItemFinishedGenerating(ProjectItem projectItem)
        {
        }

        public bool ShouldAddProjectItem(string filePath)
        {
            return true;
        }

        public void RunFinished()
        {
        }

        public void BeforeOpeningFile(ProjectItem projectItem)
        {

        }

        #endregion
    }

    public class SolutionWizard4 : SolutionWizard
    {
        protected override string DotNetVersion
        {
            get
            {
                return "v4.0";
            }
        }
    }
}
